//
//  MainTabBarController.m
//  ExhibitForcePrototype
//
//  Created by Georgi Bachvarov on 12/5/12.
//  Copyright (c) 2012 Dilyana Todorova. All rights reserved.
//

#import "MainTabBarController.h"
#import "MMAppDelegate.h"

@interface MainTabBarController ()

@property (nonatomic, strong) SettingsViewController *settingsViewController;
@property (nonatomic, strong) AnalyticsViewController *analyticsViewController;
@property (nonatomic, strong) ContentViewController *contentViewController;

@end

@implementation MainTabBarController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}


- (void)viewDidLoad
{
    [super viewDidLoad];
    self.settingsViewController = [[SettingsViewController alloc] initWithNibName:@"SettingsViewController" bundle:nil];
    self.analyticsViewController = [[AnalyticsViewController alloc] initWithNibName:@"AnalyticsViewController" bundle:nil];
    self.contentViewController = [[ContentViewController alloc] initWithNibName:@"ContentViewController" bundle:nil];
    
    self.viewControllers = [NSArray arrayWithObjects:self.contentViewController, self.settingsViewController, nil];
    
    MMAppDelegate * appDelegate = [[UIApplication sharedApplication] delegate];
    appDelegate.mainTabBarViewController = self;
    appDelegate.analyticsViewController = self.analyticsViewController;
    appDelegate.contentViewController = self.contentViewController;
    appDelegate.settingsViewController = self.settingsViewController;
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
